package pa1;

public class Test {
    public static void run(IRunning name) {
        name.run();
    }public static void swim(ISwimming name) {
        name.swim();
    }public static void fly(IFlying name) {
        name.fly();
    }

    public static void main(String[] args){
        Cat cat = new Cat("小喵");
        Duck duck = new Duck("小鸭");
        Fish fish = new Fish("小鱼");
        Frog frog = new Frog("小蛙");
        Robot robot = new Robot("机器人");

        run(cat);
        run(duck);
        run(frog);
        run(robot);

        swim(duck);
        swim(fish);
        swim(frog);

        fly(duck);
    }
}
